package com.shhic.hhplt.server.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.shhic.hhplt.server.model.Dashboard;
import com.shhic.hhplt.server.mapper.IDashboardDao;
import com.shhic.hhplt.server.service.IDashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@DS("hhpltSys")
@Transactional
public class DashboardServiceImpl implements IDashboardService {

    @Autowired
    private IDashboardDao dashboardDao;

    @Override
    public List<Dashboard> getAllDashboard() {
        return dashboardDao.getAllDashboard();
    }

    @Override
    public Dashboard getDashboard(String dashboardName) {
        return dashboardDao.getDashboard(dashboardName);
    }

    @Override
    public void deleteDashboard(String dashboardName) {
        dashboardDao.deleteDashboard(dashboardName);
    }

    @Override
    public void saveDashboard(Dashboard dashboard) {
        dashboardDao.saveDashboard(dashboard);
    }
}
